package 预科0102Phone;
/*通话套餐类 特征：通话时长、短信条数、每月资费 行为: 显示所有套餐信息*/
public class CallPlan extends PhonePlan implements CallService{
	private float callTime;
	private int textNum;
	//构造方法
	public CallPlan() {
	}
	public CallPlan(float callTime, int textNum,int cost) {
		super();
		this.callTime = callTime;
		this.textNum = textNum;
		this.cost = cost;
	}
	public void show() {
		System.out.println("套餐信息：当前套餐通话时长为"+this.getCallTime()+" 短信条数为"+this.getTextNum()+" 每月资费为"+this.getCost());
	}
	//重写通话服务方法
	@Override
	public void callService(float callTime, PhoneCard card) {
		System.out.println("通话服务：用户"+card.getName()+"卡号"+card.getCardNum()+"通话"+callTime+"分钟");
		//卡通话时间累加
		card.setCallTime(card.getCallTime()+callTime);
		//套餐通话时间剩余
		this.callTime=this.callTime-callTime;
		//卡消费金额
		card.setRemainder(card.getRemainder()-this.cost);
		
	}
	public float getCallTime() {
		return callTime;
	}
	public void setCallTime(float callTime) {
		this.callTime = callTime;
	}
	public int getTextNum() {
		return textNum;
	}
	public void setTextNum(int textNum) {
		this.textNum = textNum;
	}
	
	
}
